﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using BookDownloader.Core;
using MySql.Data.MySqlClient;

namespace BookDownloader
{
    public partial class MainForm : Form
    {
        Project project = new Project(); 
        public MainForm()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Загружает Рейтинги 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DonwloadButtonClick(object sender, EventArgs e)
        {
            project.LoadRates(true);
            bookInfoBindingSource.DataSource = project.MyBooks;
        }


        /// <summary>
        /// Обновляет базу данных со списком книг
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void UpdateDbButtonClick(object sender, EventArgs e)
        {
            project.LoadList(false);
        }




        private void MapButtonClick(object sender, EventArgs e)
        {
            project.Map(false, 50);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            project.Generate(30);
 //           BookProcessor.CreateLibrary(bookInfoBindingSource.DataSource as List<BookBase>, 30);
        }

    }
}
